package com.example.demo.mapStruct.controller;

import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;

@RestController
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private DemoMapper demoMapper;

    @GetMapping("/d1")
    public String demo1() {


      DemoPojo.vo vo = new DemoPojo.vo();
      vo.setId(1);
      //vo.setName(null);
        DemoPojo.vo5 vo5 = new DemoPojo.vo5();
        vo5.setAge(18);

        DemoPojo.vo6 vo6 = demoMapper.tVo6(vo, vo5);
        System.out.println(JSONObject.toJSONString(vo6));


        return "666";
    }
}
